package com.xyf.sys.mapper;

import com.xyf.sys.domain.SysDownloadTask;
import com.xyf.sys.domain.SysOrderLogistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SysOrderLogisticsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysOrderLogistics record);

    int insertSelective(SysOrderLogistics record);

    SysOrderLogistics selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysOrderLogistics record);

    int updateByPrimaryKey(SysOrderLogistics record);

    List<SysOrderLogistics> selectByOrderId(@Param("orderId") String orderId);

    Integer countByUserIdAndOrderId(@Param("userId") String userId, @Param("orderId") String orderId, @Param("orderProductId") String orderProductId);

    Integer countByDeptIdAndOrderId(@Param("deptId") Long deptId, @Param("orderId") String orderId, @Param("orderProductId") String orderProductId);

    List<SysOrderLogistics> selectLogisticslist(@Param("keyword") String keyword, @Param("type") Integer type, @Param("userId") String userId);

    SysOrderLogistics selectByOrderIdAndUserIdAndEventType(@Param("orderId")String orderId, @Param("orderProductId")String orderProductId, @Param("userId") String userId, @Param("eventType")Integer eventType);

    SysOrderLogistics selectByOrderIdAndDeptIdAndEventType(@Param("orderId")String orderId, @Param("orderProductId")String orderProductId, @Param("deptId") Long deptId, @Param("eventType")Integer eventType);

    List<SysOrderLogistics> selectLessThanEventTypeOrderLogisticsList(@Param("orderId") String orderId, @Param("eventType") Integer eventType);

    Integer selectLatestEventType(@Param("orderId") String orderId, @Param("orderProductId") String orderProductId);

    List<SysOrderLogistics> selectAll();
}